load("//bazel:skia_rules.bzl", "skia_cc_library")

package(
    default_applicable_licenses = ["//:license"],
)

licenses(["notice"])

skia_cc_library(
    name = "glx_factory",
    srcs = [
        "GrGLMakeGLXInterface.cpp",
    ],
    hdrs = [
        "//include/gpu/ganesh/gl/glx:public_hdrs",
    ],
    defines = ["SK_DISABLE_LEGACY_GLXINTERFACE_FACTORY"],
    visibility = ["//:__pkg__"],
    deps = [
        "//:core",
        "//:ganesh_gl",
    ],
)

skia_cc_library(
    name = "glx_factory_TEST_UTIL",
    testonly = True,
    srcs = [
        "GrGLMakeGLXInterface.cpp",
    ],
    hdrs = [
        "//include/gpu/ganesh/gl/glx:public_hdrs",
    ],
    defines = ["SK_DISABLE_LEGACY_GLXINTERFACE_FACTORY"],
    linkopts = [
        "-lGL",
        "-lGLU",
        "-lX11",
        "-lxcb",  # dep of X11
        "-lXau",  # dep of xcb
        "-lXdmcp",  # dep of xcb
    ],
    visibility = [
        "//tools/gpu:__pkg__",
        "//tools/window:__pkg__",
    ],
    deps = [
        "//:core",
        "//src/gpu/ganesh/gl:ganesh_gl_TEST_UTIL",
    ],
)
